#pragma once
#include "loadUtils.h"
/**
 * @brief Struct for storing transporter data
 */
struct TransporterVars{
	int id;
	char email[30];
	char password[30];
	char company[30];
	char town[20];
};
/**
 * @brief Array of TransporterVars structs, allocated dynamically later on
 */
struct TransporterVars *transporterdata;

/**
 * @brief keeps count of how many transporters we have, also used for memory reallocation
 */
int transportercount;

/**
 * @brief Load transporter file into memory
 *
 * @param filename
 *
 * @return return code
 */
int loadTransporters(char const *filename);

/**
 * @brief save transporterdata to file
 *
 * @param filename
 *
 * @return return code
 */
int writeTransporters(char const *filename);

/**
 * @brief add a transporter to the vector, reallocates if needed
 *
 * @param n
 */
void addTransporter(struct TransporterVars n);

/**
 * @brief removes a transporter by index, find it yourself first ;)
 *
 * @param index
 */
void rmTransporter(int index);

/**
 * @brief menu to choose between consult and modify profile data
 *
 * @param index
 */
void profileMenu(int index);

/**
 * @brief consult transporter data
 *
 * @param index
 */
void consultTransporterData(int index);

/**
 * @brief modify transporter data(id, profile,email,password,company,town)
 *
 * @param index
 */
void modifyTransporterData(int index);

/**
 * @brief modify transporter id
 *
 * @param index
 */
void modifyTransporterID(int index);

/**
 * @brief modify transporter email
 *
 * @param index
 */
void modifyTransporterEmail(int index);

/**
 * @brief modify transporter password
 *
 * @param index
 */
void modifyTransporterPassword(int index);

/**
 * @brief modify transporter company
 *
 * @param index
 */
void modifyTransporterCompany(int index);

/**
 * @brief modify transporter town
 *
 * @param index
 */
void modifyTransporterTown(int index);